Selection and Highlighting

Selection and highlighting in Silverlight Elements charts are controlled by three properties.

The SelectionMode property at the chart level specifies how selection works across multiple data series. If Single (the default), then selecting data from one series removes the selection from any other series. If Multiple, then each series maintains its own selection, and selecting an item in one series does not affect the existing selection in any other series.

The SelectionMode property at the series level specifies which points should become selected when the user clicks on a data point in the series. If None (the default), then items are never selected. If Single, then only the clicked item is selected. If All, then all items in the series are selected when any one is clicked.

The HighlightMode property (at the series level) specifies what user actions should cause a data point to become ‘hot.’ If None (the default), then items are never hot. If MouseOver, items are hot when the mouse is over the data point (bar or point symbol). If ClosestXValue, the horizontally nearest item to the mouse pointer is always hot.

To try out the different options and how they combine, see the SelectionModes page in the ChartingSampleExplorer sample.

Interaction Using Events

The Chart control also raises a set of mouse events—ChartMouseLeftButtonDown, ChartMouseMove, etc. These events allow you to detect when mouse activity occurs within the chart itself—excluding the legend, title, etc.

The ChartMouseEventArgs event data allows you to get the data values (as opposed to the screen coordinates) via the ConstrainedLogicalPoint property. For an example, see the ChartEvents page of the ChartingSampleExplorer sample.